﻿@model InShare.Model.UserEntity

<!DOCTYPE HTML>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="~/Content/css/homestyle.css" rel="stylesheet" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="~/Content/img/fav-icon.png" />
    <style>
        .head {
            height: 90px;
            text-align: center;
            color: gray;
            font-size: 30px;
        }

            .head span {
                float: left;
                margin-left: 195px;
                margin-top: 50px;
            }

        .headRight {
            float: right;
            top: 50px;
            right: 210px;
            position: relative;
        }

            .headRight a {
                color: #FF8585;
                font-size: 15px;
            }

                .headRight a:hover {
                    text-decoration: none;
                    color: #ec2b58
                }

        .myIndex {
            margin: 140px auto;
            width: 100%;
            height: 100%;
        }

        .center {
            height: 150px;
            /*background: url(image/21.jpg);*/
        }

            .center .centerTop {
                /*width: 1200px;*/
                height: 100%;
            }

                .center .centerTop img {
                    /*margin-right: 30px;*/
                }

                .center .centerTop .top1 {
                    /*width: 1000px;*/
                }
    </style>
    <script type="application/x-javascript">
        addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
    </script>
    <!----webfonts---->
    @*<link href='http://fonts.useso.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>*@
    <!----//webfonts---->
    <!-- Global CSS for the page and tiles -->
    <link href="~/Content/css/main.css" rel="stylesheet" />
    <!-- //Global CSS for the page and tiles -->
    <!---start-click-drop-down-menu----->
    <script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>

    <!----start-dropdown--->
    <script type="text/javascript">
        //var $ = jQuery.noConflict();
        $(function () {
            $('#activator').click(function () {
                $('#box').animate({ 'top': '0px' }, 500);
            });
            $('#boxclose').click(function () {
                $('#box').animate({ 'top': '-700px' }, 500);
            });
        });
        $(document).ready(function () {
            //Hide (Collapse) the toggle containers on load
            $(".toggle_container").hide();
            //Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
            $(".trigger").click(function () {
                $(this).toggleClass("active").next().slideToggle("slow");
                return false; //Prevent the browser jump to the link anchor
            });

        });
    </script>
    <!----//End-dropdown--->
    <!---//End-click-drop-down-menu----->

    @RenderSection("head", required: false)

</head>
<body>
    <!---start-wrap---->
    <!---start-header---->
    <div class="header">
        <div class="wrap">
            <div class="logo">
                <a href="/Home/Index"><img src="~/Content/img/logo.png" title="Inshare" /></a>
            </div>
            <div class="nav-icon">
                <a href="#" class="right_bt" id="activator"><span> </span> </a>
            </div>
            <div class="box" id="box">
                <div class="box_content">
                    <div class="box_content_center">
                        <div class="form_content">
                            <div class="menu_box_list">
                                <ul>
                                    <li><a href="/Home/Index"><span>Home</span></a></li>

                                    @if (@Session["userId"] != null)
                                    {
                                        <li><a href="/Post/Posting"><span>Post</span></a></li>
                                        <li><a href="/User/Edit"><span>Edit</span></a></li>
                                        <li><a href="/User/Log"><span>Log</span></a></li>
                                        <li><a href="/User/ChangePassword"><span>ChangePassword</span></a></li>
                                    }
                                    <li><a href="/Home/About"><span>About</span></a></li>
                                    <div class="clear"> </div>
                                </ul>
                            </div>
                            <a class="boxclose" id="boxclose"> <span> </span></a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="top-searchbar">
                <input id="searchTxt" type="text" value="" /><input type="submit" value="" id="btnSearch" />
            </div>
            <div class="userinfo">
                <div class="user">
                    <ul>
                        @if (@Session["userId"] == null)
                        {
                            <li>
                                <a href="/User/Login">Sign In</a>
                            </li>
                            <li>|</li>
                            <li>
                                <a href="/User/Register">Sign Up</a>
                            </li>
                        }
                        else
                        {
                            <li>
                                <a href="/User/@Session["userId"]">
                                    <span>@Session["userName"]</span>
                                    <input type="hidden" value="@Session["userId"]" id="accountId" />
                                </a>
                            </li>
                            <li>|</li>
                            <li>
                                <a href="/User/Logout">Logout</a>
                            </li>
                        }
                    </ul>
                </div>
            </div>
            <div class="clear"> </div>
        </div>
    </div>
    <!---//End-header---->

    @RenderBody()

    @RenderSection("script", required: false)

    <script>
        $(function () {
            $("#btnSearch").click(function () {
                var searchTxt = $("#searchTxt").val();
                if (searchTxt.length == 0) {
                    return;
                }
                $.ajax({
                    url: "/Post/Search/" + searchTxt,
                    type: "get",
                    dataType: "json",
                    data: { keyword: searchTxt },
                    success: function (res) {
                        if (res.Status == "OK") {
                            //alert("/Post/Search/" + searchTxt);
                            location.href = "/Post/Search/" + searchTxt;
                        }
                        else {
                            alert(res.ErrorMsg);
                        }
                    },
                    error: function () {
                        alert("网络错误");
                    }
                });
            });
        });
    </script>
    <!----start-footer--->
    <div class="footer">
        <p>&copy; @DateTime.Now.Year Inshare</p>
    </div>
    <!----//End-footer--->
</body>
</html>
